package com.wlstock.funi.Trader;

import com.wlstock.funi.fundenum.TRADE_ERROR_STATE;

/**
 * Created by admin on 16/9/18.
 */

public class TraderError {

    private final TRADE_ERROR_STATE state;
    private final String info;

    public static TraderError getError(TRADE_ERROR_STATE state){
        String info = "";
        switch (state){
            case ERROR_NOT_INTIME:
                info = "在规定时间:×";
                break;
            case ERROR_UNDER_GLOBAL_INDEX:
                info = "市场情绪:×";
                break;
            case ERROR_NOT_NEW_POSITION:
                info = "最新仓位:×";
                break;
            case ERROR_BEYOND_BUYABLE_POSITION:
                info = "有余仓可买:×";
                break;
            case ERROR_INVALID_PRICE:
                info = "价格获取:×";
                break;
            case ERROR_NOT_ENOUGH_MONEY:
                info = "有余额可买:×";
                break;
            case ERROR_NOT_ANY_STOCK:
                info = "有票子可买:×";
                break;
            case ERROR_NOT_AUTO:
                info = "自动买:×";
                break;
            case STATE_SUCCESS:
                info = "成功:√";
                break;
            default:
                info = "不知名";
                break;
        }
        return new TraderError(state, info);
    }

    private TraderError(TRADE_ERROR_STATE state, String info){
        this.state = state;
        this.info  = info;
    }

}
